package com.wnxy.sddfp.client.bank.api;

import com.wnxy.sddfp.client.bank.api.fallback.TradeLogApiFallBack;
import com.wnxy.sddfp.common.model.dto.bank.BankCardAddDTO;
import com.wnxy.sddfp.common.model.dto.bank.SignatureDto;
import com.wnxy.sddfp.common.model.result.BaseResult;
import com.wnxy.sddfp.common.model.result.Result;
import com.wnxy.sddfp.common.model.vo.BorrowSyncRecordVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(
        value = "sddfp-bank-access-service",
        path = "/trade-log",
        fallback = TradeLogApiFallBack.class
)
public interface TradeLogApi {

    /**
     * 借款记录审核，同步借款数据到银行托管系统
     */
    @PostMapping("/bank/access/sync/borrow")
    Result<BaseResult> syncBorrowRecord(@RequestBody BorrowSyncRecordVo borrowSyncRecordVo);


    /**
     * 绑卡生成交易记录 (对外暴漏的接口，也就是给客户端调用的接口)
     * 注意：这里的方法签名、路径、请求方式必须与服务提供者一致
     */
    @PostMapping("/bank/access/card")
    SignatureDto proxyBindCardLog(@RequestBody BankCardAddDTO bankCardAddDTO);

    @GetMapping("/bank/access/test01/{id}")
    Result test01(@PathVariable("id") Integer id);

}
